<?php
class Application_Model_User
{
	public function checkRegInfo($id){
		$userTable = new Application_Model_DbTable_User();
		$result = $userTable->checkRegInfo($id)->toArray();
		if(isset($result[0]['realName']) && isset($result[0]['state']) && isset($result[0]['city']) && isset($result[0]['alipay']) && isset($result[0]['mobile'])){
			return true;
		}
		return false;
	}
	
	public function checkShopInfo($userId){
		$shopTable = new Application_Model_DbTable_Shop();
		$result = $shopTable->checkShopInfo($userId);
		if(isset($result['name']) &&
		   //isset($result['logo']) && 
		   isset($result['slogen']) && 
		   isset($result['url']) && 
		   isset($result['qq']) &&
		   isset($result['msn']) &&
		   isset($result['wangwang']) &&
		   isset($result['code']) &&
		   isset($result['friendShipLinks'])){
			return true;
		}
		return false;
	}
	
	public function addedBaseInfo($data){
		$userTable = new Application_Model_DbTable_User();
		return $userTable->updateInfo($data);
	}
	
	public function addShopInfo($data){
		$shopTable = new Application_Model_DbTable_Shop();
		return $shopTable->insertShopInfo($data);
	}
}
?>